FEEDBACK on the GNAT Tutorial Found here; /opt/GNAT/2019/share/doc/gps/html/tutorial/intro.html Submitted by Tom de Havas on 26 Feb 2020 www.tomdehavas.com tomdehavas@gmail.com 00 3934 9394 9050 Hi, I am coming from a C and C++ background and looking forward to working with what I hope will be a far less adhoc approach to programming. I have always admired reliability and quality and so am now at last taking the jump to developing eventually with a team in Ada, having suffered thanks to the chaos that surrounds C but mostly C++ with the team I had now some years ago. I am very aware that the new users always use things in unexpected ways and so are particularly useful at pointing out the niggles that those more experienced can easily pass by. It is of course a lot of work to document it all which is why I asked before doing it, if you would want to use it. I hope it proves useful. If not please let me know so I don't do it again ;-) I have to say that despite the problems below it has already proved a good deal easier to get started with than some other environments I could mention in the C/C++ world. Thank you :-) **************************************************************** * Machines Setup * Two Ubuntu machines were used to run the tutorial. Both machine A and B: INSTALLATION: Other applications INSTALLATION: Has Eclipse installed for C++ development INSTALLATION: Have recently had GNAT installed in /opt/GNAT/2019/ from file "gnat-community-2019-20190517-x86_64-linux-bin" Machine A: OS: Ubuntu 18.04.03 LTS 64bit GUI: MATE 1.20.1 Kernal Linux 5.0.0-23-generic x86_64 Memory: 31.4 GiB Processor: AMD FX(tm)-8320 Eight-Core Processor Machine B OS: Ubuntu 16.04.03 LTS 64bit GUI: MATE 1.12.1 Kernal Linux 4.15.0-54-generic x86_64 Memory: 31.4 GiB Processor: AMD FX(tm)-8320 Eight-Core Processor INSTALLATION: Also Atom for various embedded boards and Arduino IDE **************************************************************** * Tutorial * 1. Introduction 2. Quick overview of the GPS areas SUGGESTION: Replace "on the left, a notebook allowing you to switch between Project, Outline and Scenario views" With "on the left hand edge of the GPS window, the view tabs of two 'notebooks' allowing you to switch between, Project and Scenario view in one, and Learn and Outline view in the other." REASON: The words Project, Scenario, Learn and Outline are not emmediately obvious to the eye. 3. Editing sources TEXT: "As you go over the various lines and labels, you will notice that by holding the mouse over a label, a tool tip pops up displaying on-line help about the selected item." PROBLEM: It seemed that when ever you open this window these tooltips will not appear for about the first 8 seconds on machine A and 21 seconds on machine B, of looking which can be confusing when trying to follow the tutorial. SUGGESTION: Either point out this delay in the tutorial or resolve the problem. 4. Building applications PROBLEM: The named icon is actually fifth not fourth from the right. FIX: Replace "Select the icon Build Main: sdc.adb on the toolbar (fourth icon from the right): this " With "Select the icon Build target: sdc.adb on the toolbar (fifth icon from the right): this " or With "Select the icon Build target: Build All on the toolbar (fourth icon from the right): this " BUT BETTER STILL: With "Select the icon tooltipped 'Build target: sdc.adb' on the toolbar (fifth icon from the right): this " or With "Select the icon tooltipped 'Build target: Build All' on the toolbar (fourth icon from the right): this " 5. Source Navigation TEXT: "Click around line 30, move the mouse over Process and let a tool tip appear " PROBLEM: These tooltips will not appear for about the first 2 seconds on machine A and 8 seconds on machine B of looking, which can be confusing when trying to follow the tutorial. SUGGESTION: Either point out this delay in the tutorial or resolve the problem. 6. Project View (entities) TEXT: "Click on the triangle to open tokens.ads entities. When you click on a file in the project view, you see language sensitive information about the file, such as packages, subprograms, and tasks for Ada." PROBLEM: There is no triangle next to the tokens.ads file in Project view! Please email me with the solution to this problem tomdehavas@gmail.com thank you Tom. 7. Back to Source Navigation TEXT: "and clicking on the middle mouse button" PROBLEM: On my system the middle mouse button is the scroll wheel which when pressed pastes text from the last copy operation just like ctrl-v. 8. Code Completion TEXT: Go to line 38 of sdc.adb. You can see there is a null instruction for the case of Stack.Overflow. We are going to add some code there, using the code assist capabilities. PROBLEM: We are not told to "add some code" not to replace the "null;"! TEXT: "Complete the list by giving e.g. “The stack is full.” for S1, “” for S2, and True for End_Line." PROBLEM1: This is not clear for anyone not familiar with the Ada language. How do you "give for "! PROBLEM2: The quotation marks in the tutorial are “The stack is full.” not "The stack is full." which is what is required. Experimentally I tried: Screen_Output.Msg (S1 => "The stack is full.", S2 => "", End_Line => True); and Screen_Output.Msg ("The stack is full.", "", True); both seemed to compile without problems but as to the correctness of either I can only guess. Perhaps a little more clarity on this. 9. Run TEXT: In the text input field (selected by default), press the right arrow key and then insert input.txt: this is the name of a text file that will be passed as argument to the sdc program. The text input should now read: %E input.txt and the full command that will be executed is displayed underneath: .../gps/tutorial/obj/sdc input.txt MINOR PROBLEM: It appears that the text input field already contains "%E input.txt" so the first paragraph is redundent and the second needs a little modification. 10. Debug TEXT: "Now select the menu Debug->Initialize->Sdc->sdc: GPS automatically switches to the Debug perspective as shown in the menu Window->Perspectives, and new windows have appeared: the variables window, the breakpoints view and the debugger console at the bottom, and the call stack window on the right." PROBLEM: Both systems A and B opened an alert message "The underlying debugger closed unexpectedly. Closing it." followed by an alert message "Could not launch the debugger" and did not go into debug mode. ATTEMPT1: Software restart! Attempted system restart! ATTEMPT2: Menu: Build->Settings->Toolchains still contains the paths /opt/gps/bin/ which point to nothing so I replaced with /opt/GNAT/2019/bin ATTEMPT3: The path /opt/GNAT/2019/bin had been added to the end of $PATH. Adding /opt/GNAT/2019/bin to the start with export PATH=/opt/GNAT/2019/bin:$PATH solved the problem for GNAT. EXPLANATION: Both machines A and B have an Eclipse C++ development environment setup and possible other development installations using gcc and other stuff. So it is likely that whatever commands were issued were being intercepted by something else. Putting GNAT at the start of $PATH may cause secondary effects for other IDEs. SUGGESTION: Could not GPS use the paths specified under Menu: Build->Settings->Toolchains rather then resorting to $PATH for any of it's needs. Who knows what $PATH will find first and what the HAZARDS of using it will be!!